home *** CD-ROM | disk | FTP | other *** search
- {$R-}
- {
- SetVolume -- An HyperCard XCMD that will set the volume of the speaker.
-
- Written by Steven Kienle, CIS account number 72330,111
-
- SetVolume should be called in HyperCard as
- SetVolume(<volume>)
- Where <volume> is between 0 and 7.
-
- After compiling this program, link it with the SetVolume.Link, then use
- ResEdit to move the XCMD resource to the appropriate stack. Or use the
- GetVolume/SetVolume stack's Install button.
-
- NOTE: for the XCmdGlue.inc file to work with TML Pascal, a few
- modifications are required.
- }
-
- {$S SetVolume } { Segment name must be the same as the command name. }
-
- UNIT DummyUnit;
-
- INTERFACE
-
- USES MacIntf, HyperXCmd;
-
- PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
-
- IMPLEMENTATION
-
- PROCEDURE SetVolume(paramPtr: XCmdPtr); FORWARD;
-
- PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
- BEGIN
- SetVolume(paramPtr);
- END;
-
- PROCEDURE SetVolume(paramPtr: XCmdPtr);
- VAR
- newVolume : LongInt ;
- pasStr : Str255 ;
- tempStr : Str31 ;
-
- {$I XCmdGlue.inc }
-
- BEGIN
- ZeroToPas(paramPtr^.params[1]^,pasStr) ; { first param is Volume }
- tempStr := pasStr ;
- newVolume := StrToNum(tempStr) ; { Convert it to a Number }
- SetSoundVol (newVolume) ; { Set the Volume }
- END;
-
- END.
-